﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using DBUtility;//Please add references
namespace TierApplication
{
    /// <summary>
    /// 类T_PRODUCTIMP。
    /// </summary>
    [Serializable]
    public partial class T_PRODUCTIMP
    {
        public T_PRODUCTIMP()
        { }
        #region Model
        private string _impbatchno;
        private DateTime? _impdate;
        private string _impuserid;
        private string _productid;
        private DateTime? _lefttime;
        private string _impstatus = "0";
        private string _auditor;
        private DateTime? _auditdate;
        private string _productname;
        private string _categoryid;
        private string _schoolid;
        private string _bandwidth;
        private string _lifetime;
        private decimal? _purchaseprice;
        private decimal? _marketprice;
        private decimal? _discount;
        private decimal? _discountprice;
        private decimal? _unitprice;
        private decimal? _point;
        private string _productimage;
        private string _descn;
        private string _remark;
        private string _remark1;
        private string _remark2;
        /// <summary>
        /// 导入批号
        /// </summary>
        public string IMPBATCHNO
        {
            set { _impbatchno = value; }
            get { return _impbatchno; }
        }
        /// <summary>
        /// 导入时间
        /// </summary>
        public DateTime? IMPDATE
        {
            set { _impdate = value; }
            get { return _impdate; }
        }
        /// <summary>
        /// 导入人
        /// </summary>
        public string IMPUSERID
        {
            set { _impuserid = value; }
            get { return _impuserid; }
        }
        /// <summary>
        /// 商品编号
        /// </summary>
        public string PRODUCTID
        {
            set { _productid = value; }
            get { return _productid; }
        }
        /// <summary>
        /// 此批商品有效期
        /// </summary>
        public DateTime? LEFTTIME
        {
            set { _lefttime = value; }
            get { return _lefttime; }
        }
        /// <summary>
        /// 当前状态 0未审核 1已审核 （审核后不能更改）
        /// </summary>
        public string IMPSTATUS
        {
            set { _impstatus = value; }
            get { return _impstatus; }
        }
        /// <summary>
        /// 审核人
        /// </summary>
        public string AUDITOR
        {
            set { _auditor = value; }
            get { return _auditor; }
        }
        /// <summary>
        /// 审核日期
        /// </summary>
        public DateTime? AUDITDATE
        {
            set { _auditdate = value; }
            get { return _auditdate; }
        }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string PRODUCTNAME
        {
            set { _productname = value; }
            get { return _productname; }
        }
        /// <summary>
        /// 商品类别
        /// </summary>
        public string CATEGORYID
        {
            set { _categoryid = value; }
            get { return _categoryid; }
        }
        /// <summary>
        /// 学校
        /// </summary>
        public string SCHOOLID
        {
            set { _schoolid = value; }
            get { return _schoolid; }
        }
        /// <summary>
        /// 带宽
        /// </summary>
        public string BANDWIDTH
        {
            set { _bandwidth = value; }
            get { return _bandwidth; }
        }
        /// <summary>
        /// 使用期限
        /// </summary>
        public string LIFETIME
        {
            set { _lifetime = value; }
            get { return _lifetime; }
        }
        /// <summary>
        /// 进价
        /// </summary>
        public decimal? PURCHASEPRICE
        {
            set { _purchaseprice = value; }
            get { return _purchaseprice; }
        }
        /// <summary>
        /// 市场价
        /// </summary>
        public decimal? MARKETPRICE
        {
            set { _marketprice = value; }
            get { return _marketprice; }
        }
        /// <summary>
        /// 折扣（%）
        /// </summary>
        public decimal? DISCOUNT
        {
            set { _discount = value; }
            get { return _discount; }
        }
        /// <summary>
        /// 折扣价
        /// </summary>
        public decimal? DISCOUNTPRICE
        {
            set { _discountprice = value; }
            get { return _discountprice; }
        }
        /// <summary>
        /// 销售单价
        /// </summary>
        public decimal? UNITPRICE
        {
            set { _unitprice = value; }
            get { return _unitprice; }
        }
        /// <summary>
        /// 积分
        /// </summary>
        public decimal? POINT
        {
            set { _point = value; }
            get { return _point; }
        }
        /// <summary>
        /// 商品图片
        /// </summary>
        public string PRODUCTIMAGE
        {
            set { _productimage = value; }
            get { return _productimage; }
        }
        /// <summary>
        /// 商品说明
        /// </summary>
        public string DESCN
        {
            set { _descn = value; }
            get { return _descn; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string REMARK
        {
            set { _remark = value; }
            get { return _remark; }
        }
        /// <summary>
        /// 备注1
        /// </summary>
        public string REMARK1
        {
            set { _remark1 = value; }
            get { return _remark1; }
        }
        /// <summary>
        /// 备注2
        /// </summary>
        public string REMARK2
        {
            set { _remark2 = value; }
            get { return _remark2; }
        }
        #endregion Model


        #region  Method

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public T_PRODUCTIMP(string IMPBATCHNO)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select IMPBATCHNO,IMPDATE,IMPUSERID,PRODUCTID,LEFTTIME,IMPSTATUS,AUDITOR,AUDITDATE,PRODUCTNAME,CATEGORYID,SCHOOLID,BANDWIDTH,LIFETIME,PURCHASEPRICE,MARKETPRICE,DISCOUNT,DISCOUNTPRICE,UNITPRICE,POINT,PRODUCTIMAGE,DESCN,REMARK,REMARK1,REMARK2 ");
            strSql.Append(" FROM T_PRODUCTIMP ");
            strSql.Append(" where IMPBATCHNO=:IMPBATCHNO ");
            OracleParameter[] parameters = {
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,50)};
            parameters[0].Value = IMPBATCHNO;

            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["IMPBATCHNO"] != null && ds.Tables[0].Rows[0]["IMPBATCHNO"].ToString() != "")
                {
                    this.IMPBATCHNO = ds.Tables[0].Rows[0]["IMPBATCHNO"].ToString();
                }
                if (ds.Tables[0].Rows[0]["IMPDATE"] != null && ds.Tables[0].Rows[0]["IMPDATE"].ToString() != "")
                {
                    this.IMPDATE = DateTime.Parse(ds.Tables[0].Rows[0]["IMPDATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IMPUSERID"] != null && ds.Tables[0].Rows[0]["IMPUSERID"].ToString() != "")
                {
                    this.IMPUSERID = ds.Tables[0].Rows[0]["IMPUSERID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["PRODUCTID"] != null && ds.Tables[0].Rows[0]["PRODUCTID"].ToString() != "")
                {
                    this.PRODUCTID = ds.Tables[0].Rows[0]["PRODUCTID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["LEFTTIME"] != null && ds.Tables[0].Rows[0]["LEFTTIME"].ToString() != "")
                {
                    this.LEFTTIME = DateTime.Parse(ds.Tables[0].Rows[0]["LEFTTIME"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IMPSTATUS"] != null && ds.Tables[0].Rows[0]["IMPSTATUS"].ToString() != "")
                {
                    this.IMPSTATUS = ds.Tables[0].Rows[0]["IMPSTATUS"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AUDITOR"] != null && ds.Tables[0].Rows[0]["AUDITOR"].ToString() != "")
                {
                    this.AUDITOR = ds.Tables[0].Rows[0]["AUDITOR"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AUDITDATE"] != null && ds.Tables[0].Rows[0]["AUDITDATE"].ToString() != "")
                {
                    this.AUDITDATE = DateTime.Parse(ds.Tables[0].Rows[0]["AUDITDATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PRODUCTNAME"] != null && ds.Tables[0].Rows[0]["PRODUCTNAME"].ToString() != "")
                {
                    this.PRODUCTNAME = ds.Tables[0].Rows[0]["PRODUCTNAME"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CATEGORYID"] != null && ds.Tables[0].Rows[0]["CATEGORYID"].ToString() != "")
                {
                    this.CATEGORYID = ds.Tables[0].Rows[0]["CATEGORYID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["SCHOOLID"] != null && ds.Tables[0].Rows[0]["SCHOOLID"].ToString() != "")
                {
                    this.SCHOOLID = ds.Tables[0].Rows[0]["SCHOOLID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["BANDWIDTH"] != null && ds.Tables[0].Rows[0]["BANDWIDTH"].ToString() != "")
                {
                    this.BANDWIDTH = ds.Tables[0].Rows[0]["BANDWIDTH"].ToString();
                }
                if (ds.Tables[0].Rows[0]["LIFETIME"] != null && ds.Tables[0].Rows[0]["LIFETIME"].ToString() != "")
                {
                    this.LIFETIME = ds.Tables[0].Rows[0]["LIFETIME"].ToString();
                }
                if (ds.Tables[0].Rows[0]["PURCHASEPRICE"] != null && ds.Tables[0].Rows[0]["PURCHASEPRICE"].ToString() != "")
                {
                    this.PURCHASEPRICE = decimal.Parse(ds.Tables[0].Rows[0]["PURCHASEPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MARKETPRICE"] != null && ds.Tables[0].Rows[0]["MARKETPRICE"].ToString() != "")
                {
                    this.MARKETPRICE = decimal.Parse(ds.Tables[0].Rows[0]["MARKETPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DISCOUNT"] != null && ds.Tables[0].Rows[0]["DISCOUNT"].ToString() != "")
                {
                    this.DISCOUNT = decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DISCOUNTPRICE"] != null && ds.Tables[0].Rows[0]["DISCOUNTPRICE"].ToString() != "")
                {
                    this.DISCOUNTPRICE = decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNTPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UNITPRICE"] != null && ds.Tables[0].Rows[0]["UNITPRICE"].ToString() != "")
                {
                    this.UNITPRICE = decimal.Parse(ds.Tables[0].Rows[0]["UNITPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["POINT"] != null && ds.Tables[0].Rows[0]["POINT"].ToString() != "")
                {
                    this.POINT = decimal.Parse(ds.Tables[0].Rows[0]["POINT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PRODUCTIMAGE"] != null && ds.Tables[0].Rows[0]["PRODUCTIMAGE"].ToString() != "")
                {
                    this.PRODUCTIMAGE = ds.Tables[0].Rows[0]["PRODUCTIMAGE"].ToString();
                }
                if (ds.Tables[0].Rows[0]["DESCN"] != null && ds.Tables[0].Rows[0]["DESCN"].ToString() != "")
                {
                    this.DESCN = ds.Tables[0].Rows[0]["DESCN"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK"] != null && ds.Tables[0].Rows[0]["REMARK"].ToString() != "")
                {
                    this.REMARK = ds.Tables[0].Rows[0]["REMARK"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK1"] != null && ds.Tables[0].Rows[0]["REMARK1"].ToString() != "")
                {
                    this.REMARK1 = ds.Tables[0].Rows[0]["REMARK1"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK2"] != null && ds.Tables[0].Rows[0]["REMARK2"].ToString() != "")
                {
                    this.REMARK2 = ds.Tables[0].Rows[0]["REMARK2"].ToString();
                }
            }
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string IMPBATCHNO)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from T_PRODUCTIMP");
            strSql.Append(" where IMPBATCHNO=:IMPBATCHNO ");

            OracleParameter[] parameters = {
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,50)};
            parameters[0].Value = IMPBATCHNO;

            return DbHelperOra.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into T_PRODUCTIMP (");
            strSql.Append("IMPBATCHNO,IMPDATE,IMPUSERID,PRODUCTID,LEFTTIME,IMPSTATUS,AUDITOR,AUDITDATE,PRODUCTNAME,CATEGORYID,SCHOOLID,BANDWIDTH,LIFETIME,PURCHASEPRICE,MARKETPRICE,DISCOUNT,DISCOUNTPRICE,UNITPRICE,POINT,PRODUCTIMAGE,DESCN,REMARK,REMARK1,REMARK2)");
            strSql.Append(" values (");
            strSql.Append(":IMPBATCHNO,:IMPDATE,:IMPUSERID,:PRODUCTID,:LEFTTIME,:IMPSTATUS,:AUDITOR,:AUDITDATE,:PRODUCTNAME,:CATEGORYID,:SCHOOLID,:BANDWIDTH,:LIFETIME,:PURCHASEPRICE,:MARKETPRICE,:DISCOUNT,:DISCOUNTPRICE,:UNITPRICE,:POINT,:PRODUCTIMAGE,:DESCN,:REMARK,:REMARK1,:REMARK2)");
            OracleParameter[] parameters = {
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,20),
					new OracleParameter(":IMPDATE", OracleType.DateTime),
					new OracleParameter(":IMPUSERID", OracleType.VarChar,20),
					new OracleParameter(":PRODUCTID", OracleType.VarChar,20),
					new OracleParameter(":LEFTTIME", OracleType.DateTime),
					new OracleParameter(":IMPSTATUS", OracleType.VarChar,1),
					new OracleParameter(":AUDITOR", OracleType.VarChar,20),
					new OracleParameter(":AUDITDATE", OracleType.DateTime),
					new OracleParameter(":PRODUCTNAME", OracleType.VarChar,100),
					new OracleParameter(":CATEGORYID", OracleType.VarChar,6),
					new OracleParameter(":SCHOOLID", OracleType.VarChar,20),
					new OracleParameter(":BANDWIDTH", OracleType.VarChar,1),
					new OracleParameter(":LIFETIME", OracleType.VarChar,6),
					new OracleParameter(":PURCHASEPRICE", OracleType.Number,12),
					new OracleParameter(":MARKETPRICE", OracleType.Number,12),
					new OracleParameter(":DISCOUNT", OracleType.Number,12),
					new OracleParameter(":DISCOUNTPRICE", OracleType.Number,12),
					new OracleParameter(":UNITPRICE", OracleType.Number,12),
					new OracleParameter(":POINT", OracleType.Number,12),
					new OracleParameter(":PRODUCTIMAGE", OracleType.VarChar,100),
					new OracleParameter(":DESCN", OracleType.VarChar,200),
					new OracleParameter(":REMARK", OracleType.VarChar,200),
					new OracleParameter(":REMARK1", OracleType.VarChar,200),
					new OracleParameter(":REMARK2", OracleType.VarChar,200)};
            parameters[0].Value = IMPBATCHNO;
            parameters[1].Value = IMPDATE;
            parameters[2].Value = IMPUSERID;
            parameters[3].Value = PRODUCTID;
            parameters[4].Value = LEFTTIME;
            parameters[5].Value = IMPSTATUS;
            parameters[6].Value = AUDITOR;
            parameters[7].Value = AUDITDATE;
            parameters[8].Value = PRODUCTNAME;
            parameters[9].Value = CATEGORYID;
            parameters[10].Value = SCHOOLID;
            parameters[11].Value = BANDWIDTH;
            parameters[12].Value = LIFETIME;
            parameters[13].Value = PURCHASEPRICE;
            parameters[14].Value = MARKETPRICE;
            parameters[15].Value = DISCOUNT;
            parameters[16].Value = DISCOUNTPRICE;
            parameters[17].Value = UNITPRICE;
            parameters[18].Value = POINT;
            parameters[19].Value = PRODUCTIMAGE;
            parameters[20].Value = DESCN;
            parameters[21].Value = REMARK;
            parameters[22].Value = REMARK1;
            parameters[23].Value = REMARK2;

            DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update T_PRODUCTIMP set ");
            strSql.Append("IMPDATE=:IMPDATE,");
            strSql.Append("IMPUSERID=:IMPUSERID,");
            strSql.Append("PRODUCTID=:PRODUCTID,");
            strSql.Append("LEFTTIME=:LEFTTIME,");
            strSql.Append("IMPSTATUS=:IMPSTATUS,");
            strSql.Append("AUDITOR=:AUDITOR,");
            strSql.Append("AUDITDATE=:AUDITDATE,");
            strSql.Append("PRODUCTNAME=:PRODUCTNAME,");
            strSql.Append("CATEGORYID=:CATEGORYID,");
            strSql.Append("SCHOOLID=:SCHOOLID,");
            strSql.Append("BANDWIDTH=:BANDWIDTH,");
            strSql.Append("LIFETIME=:LIFETIME,");
            strSql.Append("PURCHASEPRICE=:PURCHASEPRICE,");
            strSql.Append("MARKETPRICE=:MARKETPRICE,");
            strSql.Append("DISCOUNT=:DISCOUNT,");
            strSql.Append("DISCOUNTPRICE=:DISCOUNTPRICE,");
            strSql.Append("UNITPRICE=:UNITPRICE,");
            strSql.Append("POINT=:POINT,");
            strSql.Append("PRODUCTIMAGE=:PRODUCTIMAGE,");
            strSql.Append("DESCN=:DESCN,");
            strSql.Append("REMARK=:REMARK,");
            strSql.Append("REMARK1=:REMARK1,");
            strSql.Append("REMARK2=:REMARK2");
            strSql.Append(" where IMPBATCHNO=:IMPBATCHNO ");
            OracleParameter[] parameters = {
					new OracleParameter(":IMPDATE", OracleType.DateTime),
					new OracleParameter(":IMPUSERID", OracleType.VarChar,20),
					new OracleParameter(":PRODUCTID", OracleType.VarChar,20),
					new OracleParameter(":LEFTTIME", OracleType.DateTime),
					new OracleParameter(":IMPSTATUS", OracleType.VarChar,1),
					new OracleParameter(":AUDITOR", OracleType.VarChar,20),
					new OracleParameter(":AUDITDATE", OracleType.DateTime),
					new OracleParameter(":PRODUCTNAME", OracleType.VarChar,100),
					new OracleParameter(":CATEGORYID", OracleType.VarChar,6),
					new OracleParameter(":SCHOOLID", OracleType.VarChar,20),
					new OracleParameter(":BANDWIDTH", OracleType.VarChar,1),
					new OracleParameter(":LIFETIME", OracleType.VarChar,6),
					new OracleParameter(":PURCHASEPRICE", OracleType.Number,12),
					new OracleParameter(":MARKETPRICE", OracleType.Number,12),
					new OracleParameter(":DISCOUNT", OracleType.Number,12),
					new OracleParameter(":DISCOUNTPRICE", OracleType.Number,12),
					new OracleParameter(":UNITPRICE", OracleType.Number,12),
					new OracleParameter(":POINT", OracleType.Number,12),
					new OracleParameter(":PRODUCTIMAGE", OracleType.VarChar,100),
					new OracleParameter(":DESCN", OracleType.VarChar,200),
					new OracleParameter(":REMARK", OracleType.VarChar,200),
					new OracleParameter(":REMARK1", OracleType.VarChar,200),
					new OracleParameter(":REMARK2", OracleType.VarChar,200),
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,20)};
            parameters[0].Value = IMPDATE;
            parameters[1].Value = IMPUSERID;
            parameters[2].Value = PRODUCTID;
            parameters[3].Value = LEFTTIME;
            parameters[4].Value = IMPSTATUS;
            parameters[5].Value = AUDITOR;
            parameters[6].Value = AUDITDATE;
            parameters[7].Value = PRODUCTNAME;
            parameters[8].Value = CATEGORYID;
            parameters[9].Value = SCHOOLID;
            parameters[10].Value = BANDWIDTH;
            parameters[11].Value = LIFETIME;
            parameters[12].Value = PURCHASEPRICE;
            parameters[13].Value = MARKETPRICE;
            parameters[14].Value = DISCOUNT;
            parameters[15].Value = DISCOUNTPRICE;
            parameters[16].Value = UNITPRICE;
            parameters[17].Value = POINT;
            parameters[18].Value = PRODUCTIMAGE;
            parameters[19].Value = DESCN;
            parameters[20].Value = REMARK;
            parameters[21].Value = REMARK1;
            parameters[22].Value = REMARK2;
            parameters[23].Value = IMPBATCHNO;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string IMPBATCHNO)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from T_PRODUCTIMP ");
            strSql.Append(" where IMPBATCHNO=:IMPBATCHNO ");
            OracleParameter[] parameters = {
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,50)};
            parameters[0].Value = IMPBATCHNO;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public void GetModel(string IMPBATCHNO)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select IMPBATCHNO,IMPDATE,IMPUSERID,PRODUCTID,LEFTTIME,IMPSTATUS,AUDITOR,AUDITDATE,PRODUCTNAME,CATEGORYID,SCHOOLID,BANDWIDTH,LIFETIME,PURCHASEPRICE,MARKETPRICE,DISCOUNT,DISCOUNTPRICE,UNITPRICE,POINT,PRODUCTIMAGE,DESCN,REMARK,REMARK1,REMARK2 ");
            strSql.Append(" FROM T_PRODUCTIMP ");
            strSql.Append(" where IMPBATCHNO=:IMPBATCHNO ");
            OracleParameter[] parameters = {
					new OracleParameter(":IMPBATCHNO", OracleType.VarChar,50)};
            parameters[0].Value = IMPBATCHNO;

            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["IMPBATCHNO"] != null && ds.Tables[0].Rows[0]["IMPBATCHNO"].ToString() != "")
                {
                    this.IMPBATCHNO = ds.Tables[0].Rows[0]["IMPBATCHNO"].ToString();
                }
                if (ds.Tables[0].Rows[0]["IMPDATE"] != null && ds.Tables[0].Rows[0]["IMPDATE"].ToString() != "")
                {
                    this.IMPDATE = DateTime.Parse(ds.Tables[0].Rows[0]["IMPDATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IMPUSERID"] != null && ds.Tables[0].Rows[0]["IMPUSERID"].ToString() != "")
                {
                    this.IMPUSERID = ds.Tables[0].Rows[0]["IMPUSERID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["PRODUCTID"] != null && ds.Tables[0].Rows[0]["PRODUCTID"].ToString() != "")
                {
                    this.PRODUCTID = ds.Tables[0].Rows[0]["PRODUCTID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["LEFTTIME"] != null && ds.Tables[0].Rows[0]["LEFTTIME"].ToString() != "")
                {
                    this.LEFTTIME = DateTime.Parse(ds.Tables[0].Rows[0]["LEFTTIME"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IMPSTATUS"] != null && ds.Tables[0].Rows[0]["IMPSTATUS"].ToString() != "")
                {
                    this.IMPSTATUS = ds.Tables[0].Rows[0]["IMPSTATUS"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AUDITOR"] != null && ds.Tables[0].Rows[0]["AUDITOR"].ToString() != "")
                {
                    this.AUDITOR = ds.Tables[0].Rows[0]["AUDITOR"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AUDITDATE"] != null && ds.Tables[0].Rows[0]["AUDITDATE"].ToString() != "")
                {
                    this.AUDITDATE = DateTime.Parse(ds.Tables[0].Rows[0]["AUDITDATE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PRODUCTNAME"] != null && ds.Tables[0].Rows[0]["PRODUCTNAME"].ToString() != "")
                {
                    this.PRODUCTNAME = ds.Tables[0].Rows[0]["PRODUCTNAME"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CATEGORYID"] != null && ds.Tables[0].Rows[0]["CATEGORYID"].ToString() != "")
                {
                    this.CATEGORYID = ds.Tables[0].Rows[0]["CATEGORYID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["SCHOOLID"] != null && ds.Tables[0].Rows[0]["SCHOOLID"].ToString() != "")
                {
                    this.SCHOOLID = ds.Tables[0].Rows[0]["SCHOOLID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["BANDWIDTH"] != null && ds.Tables[0].Rows[0]["BANDWIDTH"].ToString() != "")
                {
                    this.BANDWIDTH = ds.Tables[0].Rows[0]["BANDWIDTH"].ToString();
                }
                if (ds.Tables[0].Rows[0]["LIFETIME"] != null && ds.Tables[0].Rows[0]["LIFETIME"].ToString() != "")
                {
                    this.LIFETIME = ds.Tables[0].Rows[0]["LIFETIME"].ToString();
                }
                if (ds.Tables[0].Rows[0]["PURCHASEPRICE"] != null && ds.Tables[0].Rows[0]["PURCHASEPRICE"].ToString() != "")
                {
                    this.PURCHASEPRICE = decimal.Parse(ds.Tables[0].Rows[0]["PURCHASEPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MARKETPRICE"] != null && ds.Tables[0].Rows[0]["MARKETPRICE"].ToString() != "")
                {
                    this.MARKETPRICE = decimal.Parse(ds.Tables[0].Rows[0]["MARKETPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DISCOUNT"] != null && ds.Tables[0].Rows[0]["DISCOUNT"].ToString() != "")
                {
                    this.DISCOUNT = decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DISCOUNTPRICE"] != null && ds.Tables[0].Rows[0]["DISCOUNTPRICE"].ToString() != "")
                {
                    this.DISCOUNTPRICE = decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNTPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["UNITPRICE"] != null && ds.Tables[0].Rows[0]["UNITPRICE"].ToString() != "")
                {
                    this.UNITPRICE = decimal.Parse(ds.Tables[0].Rows[0]["UNITPRICE"].ToString());
                }
                if (ds.Tables[0].Rows[0]["POINT"] != null && ds.Tables[0].Rows[0]["POINT"].ToString() != "")
                {
                    this.POINT = decimal.Parse(ds.Tables[0].Rows[0]["POINT"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PRODUCTIMAGE"] != null && ds.Tables[0].Rows[0]["PRODUCTIMAGE"].ToString() != "")
                {
                    this.PRODUCTIMAGE = ds.Tables[0].Rows[0]["PRODUCTIMAGE"].ToString();
                }
                if (ds.Tables[0].Rows[0]["DESCN"] != null && ds.Tables[0].Rows[0]["DESCN"].ToString() != "")
                {
                    this.DESCN = ds.Tables[0].Rows[0]["DESCN"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK"] != null && ds.Tables[0].Rows[0]["REMARK"].ToString() != "")
                {
                    this.REMARK = ds.Tables[0].Rows[0]["REMARK"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK1"] != null && ds.Tables[0].Rows[0]["REMARK1"].ToString() != "")
                {
                    this.REMARK1 = ds.Tables[0].Rows[0]["REMARK1"].ToString();
                }
                if (ds.Tables[0].Rows[0]["REMARK2"] != null && ds.Tables[0].Rows[0]["REMARK2"].ToString() != "")
                {
                    this.REMARK2 = ds.Tables[0].Rows[0]["REMARK2"].ToString();
                }
            }
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM T_PRODUCTIMP ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperOra.Query(strSql.ToString());
        }

        #endregion  Method
    }
}

